<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<!-- Created by htmlize-1.16 in css mode. -->
<html>
  <head>
    <title>GetEnv.java</title>
    <style type="text/css">
    <!--
      body {
        color: #fff8dc;
        background-color: #233b5a;
      }
      .comment {
        /* font-lock-comment-face */
        color: #66cdaa;
        font-style: italic;
      }
      .function-name {
        /* font-lock-function-name-face */
        color: #87cefa;
        font-weight: bold;
        font-style: italic;
      }
      .jde-java-font-lock-doc-tag {
        /* jde-java-font-lock-doc-tag-face */
        color: #add8e6;
      }
      .jde-java-font-lock-modifier {
        /* jde-java-font-lock-modifier-face */
        color: #add8e6;
      }
      .jde-java-font-lock-package {
        /* jde-java-font-lock-package-face */
        color: #add8e6;
      }
      .keyword {
        /* font-lock-keyword-face */
        color: #00ffff;
        font-weight: bold;
      }
      .string {
        /* font-lock-string-face */
        color: #7fffd4;
        font-style: italic;
      }
      .type {
        /* font-lock-type-face */
        color: #98fb98;
        font-weight: bold;
      }
      .variable-name {
        /* font-lock-variable-name-face */
        color: #eedd82;
        font-weight: bold;
        font-style: italic;
      }
      a {
        color: inherit;
        background-color: inherit;
        font: inherit;
        text-decoration: inherit;
      }
      a:hover {
        text-decoration: underline;
      }
    -->
    </style>
  </head>
  <body>
    <pre>
<span class="keyword">import</span> <span class="jde-java-font-lock-package">java</span>.<span class="jde-java-font-lock-package">util</span>.<span class="type">Map</span>;
<span class="keyword">import</span> <span class="jde-java-font-lock-package">java</span>.<span class="jde-java-font-lock-package">util</span>.<span class="type">TreeSet</span>;

<span class="jde-java-font-lock-modifier">public</span> <span class="keyword">class</span> <span class="type">GetEnv</span> {
  <span class="comment">/**
   * let's test generics
   * </span><span class="jde-java-font-lock-doc-tag">@param</span><span class="comment"> </span><span class="comment"><span class="variable-name">args</span></span><span class="comment"> the command line arguments
   */</span>
  <span class="jde-java-font-lock-modifier">public</span> <span class="jde-java-font-lock-modifier">static</span> <span class="type">void</span> <span class="function-name">main</span>(<span class="type">String</span>[] <span class="variable-name">args</span>) {
    <span class="comment">// get a map of environment variables
</span>    <span class="type">Map</span>&lt;<span class="type">String</span>, <span class="type">String</span>&gt; env = System.getenv();
    <span class="comment">// build a sorted set out of the keys and iterate
</span>    <span class="keyword">for</span>(<span class="type">String</span> <span class="variable-name">k</span>: <span class="keyword">new</span> <span class="type">TreeSet</span>&lt;<span class="type">String</span>&gt;(env.keySet())) {
      System.out.printf(<span class="string">"%s = %s\n"</span>, k, env.get(k));
    }
  }    
}
</pre>
  </body>
</html>
